;
; SCSI_CMD.SH Version 1.01 (C)1995,1996 HUDSON SOFT
; CD-ROMのコマンド等の定義 アセンブラ用ヘッダーファイル(SCSI_CMD.SH)
;
	ifndef	_SCSI_CMD_SH_
_SCSI_CMD_SH_	equ	1

;---  scsi command opcode  ----------------------------------------;
;---  PC-CD210  -----------------------------------;

SCMD_TEST			equ	$0000
SCMD_RSENS			equ	$0003
SCMD_READ			equ	$0008
SCMD_WRITE			equ	$000a
SCMD_INQ			equ	$0012
SCMD_MODE_SELECT		equ	$0015
SCMD_READ_EXTEND		equ	$0028
CDR_READ_TOC			equ	$00de

;---  FX SYSTEM  ----------------------------------;
;--- Group 0
TEST_UNIT_READY			equ	$0000
REZERO_UNIT			equ	$0001
REQUEST_SENSE			equ	$0003
READ				equ	$0008
SEEK				equ	$000b
NO_OPERATION			equ	$000d
INQUIRY				equ	$0012
MODE_SELECT			equ	$0015
RESERVE				equ	$0016
RELEASE				equ	$0017
MODE_SENSE			equ	$001a
START_STOP_UNIT			equ	$001b
SEND_DIAGNOSTIC			equ	$001d
PREVENT_ALLOW_MEDIUM_REMOVAL	equ	$001e

;--- group 1
READ_CDROM_CAPACITY		equ	$0025
READ_EXTENDED			equ	$0028
SEEK_EXTENDED			equ	$002b
VERIYFY				equ	$002f
PREFETCH			equ	$0034
WRITE_BUFFER			equ	$003b
READ_BUFFER			equ	$003c

;--- group 2
READ_SUB_CHANNEL		equ	$0042
READ_TOC			equ	$0043
READ_HEADER			equ	$0044
PLAY_AUDIO			equ	$0045
PLAY_AUDIO_MSF			equ	$0047
PLAY_AUDIO_TRACK_INDEX		equ	$0048
PLAY_AUDIO_TRACK_RELEATIVE	equ	$0049
PAUSE_RESUME			equ	$004b

;--- group 5
PLAY_AUDIO_12			equ	$00a5
READ_12				equ	$00a8
PLAY_AUDIO_TRACK_RELEATIVE_12	equ	$00a9
VERIFY_12			equ	$00af

;--- group 6
AUDIO_SCAN			equ	$00d2
AUDIO_TRACK_SEARCH		equ	$00d8
PLAY				equ	$00d9
STILL				equ	$00da
SET_STOP_TIME			equ	$00db
EJECT				equ	$00dc
READ_SUBCODE_Q			equ	$00dd
NEC_READ_TOC			equ	$00de

;---  request sense data  -----------------------------------------;
;---  PC-CD210  -----------------------------------;
SENSE_LEN		equ	14
S_CLASS			equ	0
S_KEY			equ	2
S_AL			equ	7
S_AKEY			equ	12

;---  FX SYSTEM  ----------------------------------;
REQUEST_SENSE_LEN	equ	18	;センスデータの長さ

;--- sense data中での各パラメータのバイト位置
SENSE_ERROR_CODE	equ	0	;Error Code と Valid bit
SENSE_KEY		equ	2	;センスキー
SENSE_INFO		equ	3	;インフォメーション バイト
SENSE_INFO_HH		equ	3	;論理ブロックアドレス high(highw )
SENSE_INFO_HL		equ	4	;論理ブロックアドレス low(highw )
SENSE_INFO_LH		equ	5	;論理ブロックアドレス high(loww )
SENSE_INFO_LL		equ	6	;論理ブロックアドレス low(loww )
SENSE_INFO_AMIN		equ	3	;絶対時間 分
SENSE_INFO_ASEC		equ	4	;絶対時間 秒
SENSE_INFO_AFRAME	equ	5	;絶対時間 フレーム
SENSE_INFO_TNO		equ	3	;曲番号
SENSE_SUB_ERROR		equ	12	;サブエラーコード

;--- bit test
SENSE_VALID_BIT		equ	$0080	;Valid ビット

;--- SENSE KEY
NO_SENSE		equ	$00
NOT_READY		equ	$02
MEDIUM_ERROR		equ	$03
HARDWARE_ERROR		equ	$04
ILLEGAL_REQUEST		equ	$05
UNIT_ATTENTION		equ	$06
ABORTED_COMMAND		equ	$0b

;--- SUB ERROR
VIOD_SENSE_DATA			equ	$0000
DRIVE_NOT_READY			equ	$0004
NO_DISC				equ	$000b
DISC_EJECT			equ	$000d
DATA_FIELD_UNCORRECT		equ	$0011
SEEK_ERROR			equ	$0015
HEADER_READ_ERROR		equ	$0016
NOT_DIGITAL_AUDIO_TRACK		equ	$001c
NOT_CDROM_DATA_TRACK		equ	$001d
INVALID_COMMAND			equ	$0020
INVALID_ADDRESS			equ	$0021
INVALID_PARAMETER		equ	$0022
INVALID_COMMAND_SEQUENCE	equ	$0024
END_OF_VOLUME			equ	$0025
INVALID_REQUEST_IN_CDB		equ	$0027
DISC_CHANGED			equ	$0028
UNIT_RESET			equ	$0029
INVALID_PARAMETER_LIST		equ	$002a
NOT_AUDIO_PLAY_STATE		equ	$002c
INVALID_MESSAGE			equ	$002d
INITIATORS_ID_UNDEFINED		equ	$002f
PARITY_ERROR			equ	$0030
ABORT_COMMAND			equ	$0032
INTERFACE_TIMEOUT		equ	$003e

;---  mode select  --------------------------------;
SELECT_LEN		equ	10
MDSL_BLOCK_LEN		equ	3

;--- SCSI-2
MDSL_BDL		equ	3
MDSL_DENSITY		equ	0
MDSL_BL_2		equ	5
MDSL_BL_1		equ	6
MDSL_BL_0		equ	7

;--- vendor unique
MDSL_FORMAT		equ	4
MDSL_RETRY		equ	9
MDSL_XA_BIT		equ	$0080
MDSL_SH_BIT		equ	$0040
MDSL_EC_BIT		equ	$0004
MDSL_EJ_0		equ	0
MDSL_EJ_1		equ	1
MDSL_EJ_2		equ	2
MDSL_EJ_3		equ	3

MODE1_NORMAL		equ	$0000
MODE1_MODE2_2340	equ	$0003
MODE2_FORM1_NORMAL	equ	$00c1

CDMODE_0		equ	0
CDMODE_1		equ	1
CDMODE_2		equ	2

HEADER_CDMODE		equ	3

;---  NEC READ TOC  -------------------------------;
READ_TOC_TYPE0		equ	0
READ_TOC_TYPE1		equ	1
READ_TOC_TYPE2		equ	2
READ_TOC_TYPE3		equ	3

READ_TOC_LEN012		equ	4	;type 00-02
READ_TOC_LEN3		equ	12	;type==03 && TNO!=0

TOC_TYPE0_MIN		equ	0
TOC_TYPE0_MAX		equ	1

TOC_TYPE1_AMIN		equ	0
TOC_TYPE1_ASEC		equ	1
TOC_TYPE1_AFRAME	equ	2

TOC_TYPE2_AMIN		equ	0
TOC_TYPE2_ASEC		equ	1
TOC_TYPE2_AFRAME	equ	2
TOC_TYPE2_CTRL		equ	3

CD_DATA_TRACK		equ	$0004	;flag bit

TOC_NO_A0		equ	$00a0
TOC_NO_A1		equ	$00a1
TOC_NO_A2		equ	$00a2
TOC_NO_B0		equ	$00b0
TOC_NO_00		equ	$0000

TOC_TYPE3_LENGTHH	equ	0
TOC_TYPE3_LENGTHL	equ	1

;------------------------------------------------------------------;
	endif	; !_SCSI_CMD_SH_
